import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:github_client_app/page/assets/person.dart';
import 'package:github_client_app/router/navigator_util.dart';
import 'package:github_client_app/router/routes.dart';

class AssetsPage extends StatefulWidget {
  const AssetsPage({Key? key}) : super(key: key);

  @override
  _AssetsPageState createState() => _AssetsPageState();
}

class _AssetsPageState extends State<AssetsPage>
    with AutomaticKeepAliveClientMixin {
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    // timeDilation = 5;
  }

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        const Center(child: Text("资产中心")),
        ElevatedButton(
            onPressed: () {
              Navigator.pushNamed(context, Routes.detailPage);
            },
            child: const Text("去详情页")),
        ElevatedButton(
            onPressed: () {
              NavigatorUtil.push(context, '/login/2323');
            },
            child: const Text("去登陆")),
        GestureDetector(
          onTap: () {
            NavigatorUtil.push(context, '/login/2323');
          },
          child: Hero(
            tag: 'hhh',
            child: Container(
              width: 100,
              height: 100,
              decoration:
                  BoxDecoration(shape: BoxShape.circle, color: Colors.amber),
              child: Text(
                'Hello',
                style: TextStyle(fontSize: 20),
              ),
            ),
          ),
        ),
        ElevatedButton(
            onPressed: () {
              NavigatorUtil.push(context, Routes.paramsPage,
                  arguments: Person(name: 'test', habby: 'ball', age: 15));
            },
            child: const Text("去params")),
      ],
    );
  }

  @override
  bool get wantKeepAlive => true;
}
